package com.th.common.utils.base64.picture;


/**
 * Base64编码图片工具
 *
 * @author: tuhang
 * @date: 2022/5/13
 **/
public class Base64PictureUtils {
    /**
     * 判断base64图片格式是否为png
     *
     * @param base64Data 图片base64编码
     */
    public static boolean isPng(String base64Data) {
        if (base64Data == null || "".equals(base64Data)) {
            return false;
        } else {
            String[] d = base64Data.split("base64,");
            if (d.length == 2) {
                return d[0].indexOf("data:image/png;") == 0;
            } else {
                return false;
            }
        }
    }
}
